package com.InsideGamer.SuperJailBreak;

import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerTeleportEvent;

public class UserFunctions
{
	private JailBreak plugin;
	
	public UserFunctions ( JailBreak pluginInstance )
	{
		plugin = pluginInstance;
	}
	
	public void checkValidTP ( PlayerTeleportEvent event, Player player, Location toLocation )
	{
		for ( Player target : plugin.getServer().getOnlinePlayers() )
		{
			if ( plugin.users.IsHidden ( target ) )
			{
				if ( target.getLocation().equals ( toLocation ) )
				{
					event.setCancelled ( true );
				}
			}
		}
	}
}